<div class="panel panel-primary" xmlns="http://www.w3.org/1999/html">
    <div class="panel-heading">
        <p class="text-center"><%= @group.name %></p>
    </div>
    <div class="panel-body">
        <!--<span class="label label-primary">简述</span>-->

        <p>
            <div class="alert alert-info"><%= @group.description %></div>
        </p>

        <!--<hr>-->
        <!--<span class="label label-primary">成员</span>-->
        <p></p>

        <p>
            <% group.members.each do |guser| %>
               <!-- <span class="label label-info"><%= link_to guser.name, user_path(guser) %></span>-->
              <%= render "common/user_icon", user: guser %>
            <% end %>
        </p>
    </div>
    <div class="panel-footer">
        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#billModal" data-whatever="@mdo">记账</button>
    </div>
</div>

<div class="modal fade" id="billModal" tabindex="-1" role="dialog" aria-labelledby="billModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="billModalLabel">建立账单</h4>
            </div>
            <div class="modal-body">
                <%= render "bills/form", bill: @new_bill, edit_tag: false  %>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" id="mysubmit" class="btn btn-primary mysubmit">提交</button>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('#billModal').on('show.bs.modal', function (e) {
        $(":submit").hide();
        //$("#new_bill").enableClientSideValidations();
        $(".mysubmit").click(function () {
            $("#new_bill").submit();
        })
    })

</script>